package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.AssetsNo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/AssetsNoMapper.class */
public interface AssetsNoMapper {
    @Select({"<script>select * from assets_no <where> <if test='type != null and type.length() &gt; 0'> type = #{type} </if><if test='buildNum != null and buildNum.length() &gt; 0'>and build_num = #{buildNum} </if><if test='sectionId != null '>and section_id = #{sectionId} </if></where></script>"})
    AssetsNo findByType(@Param("type") String str, @Param("buildNum") String str2, @Param("sectionId") Integer num);

    @Update({"<script>update assets_no set counter=counter+1 <where> <if test='type != null and type.length() &gt; 0'> type = #{type} </if><if test='buildNum != null and buildNum.length() &gt; 0'>and build_num = #{buildNum} </if><if test='sectionId != null '>and section_id = #{sectionId} </if></where></script>"})
    Integer update(@Param("type") String str, @Param("buildNum") String str2, @Param("sectionId") Integer num);

    @Insert({"insert into assets_no (type,build_num,section_id,counter,stop_time,build_unit) values (#{type,jdbcType=VARCHAR},#{buildNum,jdbcType=VARCHAR},#{sectionId,jdbcType=VARCHAR},#{counter,jdbcType=VARCHAR},#{stopTime,jdbcType=VARCHAR},#{buildUnit,jdbcType=VARCHAR}) "})
    int add(@Param("type") String str, @Param("buildNum") String str2, @Param("sectionId") Integer num, @Param("counter") Integer num2, @Param("stopTime") String str3, @Param("buildUnit") String str4);

    @Select({"<script>select MAX(counter) from assets_no <where> <if test='type != null and type.length() &gt; 0'> type = #{type} </if><if test='stopTime != null and stopTime.length() &gt; 0'>and stop_time = #{stopTime} </if><if test='buildUnit != null '>and build_unit = #{buildUnit} </if></where></script>"})
    Integer selectCounter(@Param("type") String str, @Param("stopTime") String str2, @Param("buildUnit") String str3);
}